package com.wunong.smart.commission.application.context;

import com.wunong.smart.commission.application.request.BaseCommissionRequest;
import com.wunong.smart.commission.domain.model.CommissionDomain;
import com.wunong.smart.domain.platform.context.SimpleContext;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 代办Context
 *
 * @author create by zealot.zt
 */
@Getter
@Setter
@ToString(callSuper = true)
public class CommissionContext<REQ extends BaseCommissionRequest> extends SimpleContext<REQ, CommissionDomain> {

    public static <REQ extends BaseCommissionRequest> CommissionContext<REQ> of(REQ request, CommissionDomain domain) {
        CommissionContext<REQ> context = CommissionContext.of(request);
        context.setModel(domain);
        return context;
    }

    public static <REQ extends BaseCommissionRequest> CommissionContext<REQ> of(REQ request) {
        CommissionContext<REQ> context = new CommissionContext<>();
        context.setRequest(request);
        return context;
    }

}
